﻿using System;
using fastCSharp.code.cSharp;
using fastCSharp.net;

namespace diantou.web.ajax
{
    /// <summary>
    /// 课程分页操作
    /// </summary>
    [fastCSharp.code.cSharp.ajax(IsPool = true)]
    class coursePage : userHandle<coursePage>
    {
        /// <summary>
        /// 获取课程分页
        /// </summary>
        /// <param name="courseId"></param>
        /// <param name="pageId"></param>
        /// <param name="onReturn"></param>
        public void Get(int courseId, byte pageId, Action<returnValue<diantou.dataModel.coursePage>> onReturn)
        {
            diantou.dataAccess.tcpCall.coursePage.getUserPage(courseId, pageId, currentUser.Id, onReturn);
        }
        /// <summary>
        /// 完成课程处理
        /// </summary>
        /// <param name="courseId"></param>
        /// <param name="onReturn"></param>
        public void Finally(int courseId, Action<returnValue<bool>> onReturn)
        {
            diantou.dataAccess.tcpCall.coursePage.userFinally(currentUser.Id, courseId, onReturn);
        }
        /// <summary>
        /// 课程测试
        /// </summary>
        /// <param name="courseId"></param>
        /// <param name="pageId"></param>
        /// <param name="value"></param>
        /// <param name="onReturn"></param>
        public void Judge(int courseId, byte pageId, diantou.dataAccess.judge value, Action<fastCSharp.net.returnValue<diantou.dataAccess.judgeClient.testJudge>> onReturn)
        {
            value.UserId = currentUser.Id;
            diantou.dataAccess.tcpCall.judge.courseJudge(courseId, pageId, value, onReturn);
        }
    }
}
